//
//  CLUIBaseViewController.h
//  CityHunter
//
//  Updated by xcq on 14-10-22.
//  Copyright (c) 2014年 CieNet. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "CLUIBaseTableViewController.h"
#import "ConfigDefine.h"
#import <Masonry.h>
#import "UserDataMarco.h"
#import <UIView+Toast.h>
#import "SVProgressHUD.h"
#import "LocationGetObj.h"
#import "Notification.h"
#define getStoryOfControllerInstance(value)  [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:value]

#define Point @"1234567890/n"
#define RMB @"¥"

#define WS(weakSelf) __weak __typeof(&*self)weakSelf = self;

#define TOASTSHOW(value) [self.view makeToast:value duration:TOSTEDURATION position:TOP_POINT];
#define TOSTEDURATION 1.0f
#define TOP_POINT [NSValue valueWithCGPoint:CGPointMake([UIScreen mainScreen].bounds.size.width / 2, ([UIScreen mainScreen].bounds.size.height  / 2.6) )]


#define kTitleBarHeight 64.0
#define kBottomBarHeight                    44.0
#define kNavigationBarLeftBtnTag                1000
#define kNavigationBarRightBtnTag               1001
#define kRequestFailRetBtnTag                   9999


#ifndef GET_VIEW_RIGHT
#define GET_VIEW_RIGHT(view) (view.frame.origin.x + view.frame.size.width)
#endif
#ifndef GET_VIEW_BOTTOM
#define GET_VIEW_BOTTOM(view) (view.frame.origin.y + view.frame.size.height)
#endif
#define FrameHeight 64
#define NSINTCONVERSTR(value)     [NSString stringWithFormat:@"%ld",value]
#define NSUINTCONVERSTR(value)    [NSString stringWithFormat:@"%zd",value]
#define INTCONVERSTR(value)       [NSString stringWithFormat:@"%d",value]
#define FLOATCONVERSTR(value)     [NSString stringWithFormat:@"%f",value]

//测拉背景图
#define slideViewBackImg @"background_gerenzhongxin"
#define TIPS(value) [self.navigationController.topViewController.view makeToast:value duration:1.5f position:@"center"];

#define TIPSFORVIEW(value) [self.view makeToast:value duration:0.7f position:@"center"];

#define NUMBERCONVERSTR(value) [NSString stringWithFormat:@"%@",value]

#define REQUESTCLASS(value)  [_requestClass isEqualToString:value]
#define KAnimation 0.5f

#define ViewFrameOriginX(vi) vi.frame.origin.x
#define ViewFrameOriginY(vi) vi.frame.origin.y
#define ViewFrameSizeW(vi) vi.frame.size.width
#define ViewFrameSizeH(vi) vi.frame.size.height
#define Tmptoken (@"e388f02f750e65ebba95ab9493cda01e")
typedef enum PostRequestPropertyType {
    PostRequestPropertyJson,
    PostRequestPropertyXml
} PostRequestPropertyType;

@interface CLUIBaseViewController : UIViewController <UIGestureRecognizerDelegate,UITextFieldDelegate>
@property (nonatomic, retain) UIView *editingTextInputView;
@property (nonatomic ,retain) LocationGetObj *locService;
@property (nonatomic ,retain) CLLocationManager *locationManager;
@property (nonatomic , copy)  NSString *requestClass;
/**
 * 自定义Nav左按钮
 * @parama 左边标题
 */
- (void)showNavgationWithLeftItemWithTitle:(NSString *)title;


- (void)showNavgationWithLeftItemWithTitle:(NSString *)title twoItemWithtitle:(NSString *)titleT;
/**
 * 自定义Nav左右按钮(左以图片的形式，右边以图片形式且双按钮)
 * @parama 右边按钮的title
 * @parama 右边按钮的SEL
 */
- (void)showNavBarWithRightOneImage:(UIImage *)rightOneImage
                   andRightTwoImage:(UIImage *)rightTwoImage
             andRightTwoSelectImage:(UIImage *)rightTwoSelectImage
                  andRightOneAction:(SEL)ractionOne
                   andRighTwoAction:(SEL)ractionTwo;

/**
 * 自定义Nav左右按钮(左以图片的形式，右边文字可设置文字大小和宽度)
 * @parama 右边按钮的title
 * @parama 右边按钮的SEL
 * @parama 左边按钮的SEL
 * @parama 左边按钮的图片
 */
- (void)showNavBarWithRightTitle:(NSString *)rightTitle
                  andRightAction:(SEL)raction
                      andLeftImg:(NSString *)imageName
                   andLeftAction:(SEL)laction
                     andFontSize:(CGFloat)size
                   andRightWidth:(CGFloat)width;

/**
 * 自定义Nav左右按钮(左以图片的形式，右边可图片可文字)
 * @parama 右边按钮的图片或者title，取其一
 * @parama 右边按钮的SEL
 * @parama 左边按钮的SEL
 * @parama 左边按钮的图片
 */
- (void)showNavBarLeftImgAndRightTitle:(NSString*)title
                          andRightImge:(UIImage *)rImg
                        andRightAction:(SEL)raction
                         andLeftAction:(SEL)laction
                           andLeftImge:(UIImage *)img;
/**
 *  @brief  自定义Nav左右按钮(左以图片的形式，右边可图片可文字，且可以定义选中状态的图片)
 *
 *  @param title      右边控件的文字
 *  @param rImg       右边控件的图片
 *  @param selectImg  右边控件的选中图片
 *  @param raction    右边控件的点击事件
 *  @param laction    左边控件的点击事件
 *  @param img        左边控件的图片
 *  @param selectLimg 左边控件的选中图片
 */
- (void)showNavBarLeftImgAndRightTitle:(NSString*)title
                          andRightImge:(UIImage *)rImg
                     andRightSeleteImg:(UIImage *)selectImg
                        andRightAction:(SEL)raction
                         andLeftAction:(SEL)laction
                           andLeftImge:(UIImage *)img
                      andLeftSeleteImg:(UIImage *)selectLimg ;
/**
 * 自定义Nav左右按钮(左右按钮可加Badge)
 * @parama 左右图标的图片
 * @parama 左右按钮的SEL
 * @parama 左右显示badge的数量
 * @parama 设置NavagationBar的颜色
 */
- (void)showNavBarWithRightImage:(UIImage *)rimage
                    LeftBtnImage:(UIImage *)limage
               andRightBtnAction:(SEL)raction
                andLeftBtnAction:(SEL)laction
                   andRightBadge:(NSInteger)rnum
                     andLeftBage:(NSInteger)lnum
                           title:(NSString *)title
                        barColor:(UIColor *)color;

/**
 * 自定义Nav左右按钮(左以图片的形式，右边文字,或者右边没有按钮显示)
 * @parama 右边按钮的title
 * @parama 右边按钮的SEL
 * @parama 左边按钮的SEL
 * @parama 左边按钮的图片
 */
- (void)showNavBarWithRightTitle:(NSString *)rightTitle
                  andRightAction:(SEL)raction
                   andLeftAction:(SEL)laction
               andRightBtnIsShow:(BOOL) isShow;

/**
 * 自定义Nav左右按钮(加提示红点)
 * @parama 左右图标的图片
 * @parama 左右按钮的SEL
 * @parama 左右是否显示红点
 */
- (void)showNavBarLeftAndRightSetByLeftImage:(UIImage *)limage
                               andRightImage:(UIImage *)rimage
                               andLeftAction:(SEL)laction
                              andRightAction:(SEL)raction
                      andleftShowRedTipPoint:(BOOL)isLeftShow
                     andRightShowRedTipPoint:(BOOL)isRightShow;

/**
 * 设置Nav左右按钮的Badge
 * @parama 左边按钮的Badge
 * @parama 右边按钮的Badge
 */
- (void)showNavBarLeftAndRightBadgeNum:(NSUInteger)lbadge
                              andRight:(NSUInteger)rbadge ;
/**
 * 设置Nav左按钮的Badge
 * @parama 左边按钮的Badge
 */
- (void)showNavBarLeftBadge:(NSUInteger)badge;

/**
 * 设置Nav右按钮的Badge
 * @parama 右边按钮的Badge
 */
- (void)showNavBarRightBadge:(NSUInteger)badge;

/**
 * 移除Nav左按钮的Red
 */
- (void)removeRedPoint;

/**
 * 设置Nav左按钮的Red
 */
- (void)addRedPoint;

/**
 * 删除Nav左右按钮的Badge
 */
- (void)removeNavRedPoint;
/**
 * 删除Nav左按钮的Badge
 */
- (void)removeNavLeftRedPoint;
/**
 * 删除Nav右按钮的Badge
 */
- (void)removeNavRightRedPoint;

- (void)setNavBarBgImgView:(NSString *)imageStr;
- (void)showNavBarWithTitle:(NSString *)title;
- (void)setUp;
- (void)backTo;
- (void)rightBtnAction;

- (void)displayMask;

- (void)hideMask;

- (BOOL)isPresent;

//设置分割线到头
- (void)separatorForTableView:(UITableView *)tableView;
@end
